package com.awn.weidian.demo.mapper;


import  com.awn.weidian.demo.pojo.Goods;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;




import java.util.List;

@Mapper
public interface IGoods {

    @Select("select * from goods")
    public List<Goods> showList();

    @Select("select * from goods where state=#{state}")
    public List<Goods> showState(int state);

    @Select("select * from goods where shopdele=#{shopdele}")
    public List<Goods> selectState(int state);

    @Update("update goods set gname=#{gname},gtitle=#{gtitle},cid=#{cid},oldprice= #{oldprice},newprice= #{newprice},rid =#{rid},uid= #{uid},goodsnumber= #{goodsnumber},sellnumber= #{sellnumber},details= #{details},shelftime= #{shelftime},examine= #{examine},examinetime= #{examinetime},goodsimg= #{goodsimg},state=#{state},shopdele=#{shopdele},Without_excuse=#{Without_excuse} where gid=#{gid}")
    public int update(Goods goods);

    @Insert("insert into goods(gname,gtitle,cid,oldprice,newprice,rid,uid,goodsnumber,sellnumber,details,shelftime,examine,examinetime,goodsimg,shopdele,Without_excuse) values(#{gname},#{gtitle},#{cid},#{oldprice},#{newprice},#{rid},#{uid},#{goodsnumber},#{sellnumber},#{details},#{shelftime},#{examine},#{examinetime},#{goodsimg},#{shopdele},#{Without_excuse})")
    public int addGoods(Goods goods);



}
